WIP implementation of protocol 1.7#303
Draft
SomberNight wants to merge 27 commits into
Draft
Conversation
938fde4 to
6370b49
Compare
0bd41f1 to
525d000
Compare
ecdsa
reviewed
Apr 29, 2026
525d000 to
b9abbff
Compare
ecdsa
reviewed
Apr 30, 2026
ecdsa
reviewed
May 2, 2026
|
|
||
| PROTOCOL_MIN = (1, 4) | ||
| # consider bumping Coin.MIN_REQUIRED_DAEMON_VERSION too when releasing a new protocol version | ||
| PROTOCOL_MAX = (1, 6, 0) |
1303e45 to
a1f2942
Compare
e082f75 to
170e9f5
Compare
with the pending db changes, an upgrade is ~as fast as a resync from genesis
In Bitcoin consensus, a txout index is stored as a uint32_t. However, in practice, an output in a tx uses at least 10 bytes (for an OP_TRUE output), so - to exhaust a 2 byte namespace, a tx would need to have a size of at least 2 ** 16 * 10 = 655 KB, - to exhaust a 3 byte namespace, a tx would need to have a size of at least 2 ** 24 * 10 = 167 MB.
History.get_txnums and History.backup depend on ordering of tx_nums, so we want the lexicographical order (used by leveldb comparator) to match the numerical order.
For 1 million blocks, in a python dict, I guess this might take around 100 MB of RAM. // - block_hash is 32 bytes, block_height is a varsize int // - dict size seems to increase by 93 bytes for every new item // - however there is considerable additional overhead, I guess amortized over many adds, // for the hashmap. Looks like it takes around ~145 bytes per item overall.
squashed with:
- "blockchain.outpoint.subscribe" RPC: add optional "spk_hint" argument
- "blockchain.outpoint.subscribe" RPC: implement notifications
- "blockchain.outpoint.subscribe" RPC: distinguish heights "-1" and "0"
Similar to scripthash statuses, the height of an unconfirmed tx is:
- `-1` if it has any unconfirmed parents,
- `0` otherwise.
- session: implement "blockchain.outpoint.get_status" RPC
- "blockchain.outpoint.subscribe": use bitcoind 31 gettxspendingprevout
txid_rev: txid in same endianness as prevouts are serialised in a raw tx txid_hum: txid in endianness used for human-readable display typically (these are reverses of each other)
e.g. to make it clear that these are methods that really need to do input sanitization
- also, in a recent commit I added prefixes to the db "state" keys: now add missing handling of old unprefixed keys to detect old DBs
postponing this from protocol 1.7 -- the motivation for adding this field was reliant on the "height" arg being optional, which we are also postponing.
170e9f5 to
f6100ce
Compare
and raise the max line limit as it is more annoying than useful
f503001 to
21465a7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WIP implementation of spesmilo/electrum-protocol#2